<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%base_idcard_type}}".
 *
 * @property int $id
 * @property string $name 类型名称
 * @property string $pattern 正则校验表达式
 * @property int $disabled 开启状态：0开启，1关闭
 */
class BaseIdcardType extends \common\db\ActiveRecord {

    use \common\traits\Constants;

    /**
     * 禁用状态
     * @var DISABLED_ON  1  禁用
     * @var DISABLED_OFF  0  启用
     */
    const DISABLED_ON = 1;
    const DISABLED_OFF = 0;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%base_idcard_type}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['name'], 'required'],
            [['disabled'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['pattern'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'name' => '证件类型',
            'pattern' => '正则校验表达式',
            'disabled' => '开启状态：0开启，1关闭',
        ];
    }

}
